import com.google.protobuf.Descriptors;
import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.ProtocolStringList;
import com.huixiong.model.DemoProtos;

import org.junit.Test;

/**
 * <描述>
 *
 * @author timothy.yang cloudwise
 * @since 2021-09-23 16:26
 */
public class person_test {

    @Test
    public void parse_test() throws InvalidProtocolBufferException {
        DemoProtos.Person person = DemoProtos.Person.newBuilder().addAge(1).addAge(2).setName("huixiong").build();
        byte[] bytes = person.toByteArray();
        System.out.println(bytes);
        DemoProtos.Person person1 = DemoProtos.Person.parseFrom(bytes);
        System.out.println(person1.getAge(1));
    }

    @Test
    public void default_instance_test(){
        DemoProtos.SearchRequest defaultInstance = DemoProtos.SearchRequest.getDefaultInstance();
        System.out.println(defaultInstance.isInitialized());
    }

    @Test
    public void demo_test(){
        DemoProtos.SearchRequest build = DemoProtos.SearchRequest.newBuilder().build();
    }
}
